import QtQuick 2.0

Rectangle{
    width: 360; height: 240
    color: "#eeeeee"
    id: rootItem

    Rectangle{
        id: rect
        color: "blue"
        width: 200; height: 200
        anchors.centerIn: parent
        MouseArea{
            id: mouseArea
            anchors.fill: parent
        }
        states: [
            State {
                name: "restWidth"
                when: mouseArea.pressed
                PropertyChanges {
                    target: rect
                    restoreEntryValues: false
                    color: "red"
                    width: parent.width
                    explicit: true
                }
            }
        ]
    }
}

